import axios from "axios";

let base = '';

//传送json格式的请求
/**
 * POST
 */
export const postRequest = (url, params) => {
    return axios({
        method: 'post',
        url: `${base}${url}`,
        data: params
    })
}

/**
 * PUT
 */
export const putRequest = (url, params) => {
    return axios({
        method: 'PUT',
        url: `${base}${url}`,
        data: params,

    })
}
/**
 * GET
 */
export const getRequest = (url, params) => {
    return axios({
        method: 'GET',
        url: `${base}${url}`,
        data: params
    })
}

/**
 * DELETE
 */
export const deleteRequest = (url, params) => {
    return axios({
        method: 'DELETE',
        url: `${base}${url}`,
        data: params
    })
}